from selenium import webdriver
from selenium.webdriver.common.by import By
from time import sleep

url = 'https://imooc.com'
driver = webdriver.Chrome(executable_path='/usr/local/bin/chromedriver')
driver.get(url)
print('get over')
sleep(2)
input_element = driver.find_element(By.CLASS_NAME, 'nav-search-input')
input_element.clear()
input_element.send_keys("小布_老师")
sleep(2)

search_element = driver.find_element(By.CLASS_NAME, 'nav-searchBtn')
search_element.click()
print("click over")
sleep(2)

driver.back()

sleep(5)
driver.quit()
